import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { IndexComponent } from './index.component';
import {FirstComponent} from './first/first.component';
import {WelcomeComponent} from './welcome/welcome.component';
import {DemoComponent} from './demo/demo.component';

const routes: Routes = [
  {
    path: '',
    component: IndexComponent ,
    children: [
      {
        path: '',
        component: FirstComponent
      },
      {
        path: 'welcome',
        component: WelcomeComponent
      },
      {
        path: 'demo',
        component: DemoComponent
      }
    ]
  }
  ];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class IndexRoutingModule { }
